﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditInsurance.aspx.cs" Inherits="DLV.BackEnd.Pages.EditInsurance" %>
<%@ Register Src="~/Controls/TinyMCE.ascx" TagPrefix="uc1" TagName="TinyMCE" %>

<asp:content id="Content1" contentplaceholderid="placeHolderContent" runat="server">
    <div id="toolbar-box">
		<div class="t">
			<div class="t">
				<div class="t"></div>
			</div>
		</div>
		<div class="m">
		    <div id="toolbar" class="toolbar">
			    <table class="toolbar">
			        <tbody>
					    <tr>
						    <td id="toolbar-save" class="button">
						        <asp:LinkButton ID="lbtSave" runat="server" Text="" onclick="lbtSave_Click" CssClass="toolbar">
					                <span id="Span1" title="Save" class="icon-32-save" runat="server"></span>Lưu
					            </asp:LinkButton>
						    </td>
						    <td id="toolbar-cancel" class="button">
						        <asp:LinkButton ID="lbtClose" runat="server" Text="" onclick="lbtClose_Click" 
                                    CssClass="toolbar" CausesValidation="False">
					                <span id="Span2" title="Close" class="icon-32-cancel" runat="server"></span>Thoát
					            </asp:LinkButton>
						    </td>
					    </tr>
				    </tbody>
			    </table>
		    </div>
			<div class="header">Thêm mới/chỉnh sửa bảo hiểm</div>
			<div class="clr"></div>
		</div>
		<div class="b">
			<div class="b">
				<div class="b"></div>
			</div>
		</div>
	</div>
	<div id="element-box">
		<div class="t">
			<div class="t">
				<div class="t"></div>
			</div>
		</div>
		<div class="m" style="float:left; width:100%">
			<div class="admin-left">
                <table class="adminform">
                    <tr>
						<td colspan="2">
                            <div id="ErorMessage" style="color: Red;line-height: 150%;"></div>
                        </td>
					</tr>
                    <tr>
                        <td style="width: 20%;">Tên&nbsp;bảo&nbsp;hiểm</td>
                        <td><asp:TextBox id="txtInsuranceName" runat="server" Width="400px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>Đối tác</td>
                        <td>
                            <asp:DropDownList ID="ddlPartner" runat="server" Width="413px"></asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>Mức&nbsp;bảo&nbsp;hiểm</td>
                        <td><asp:TextBox id="txtInsuranceLevel" runat="server" Width="400px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>Ngày hiệu lực: </td>
                        <td>
                            <input type="text" id="dteInsuranceBegin" placeholder="Click để chọn ngày" readonly="readonly" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>Mô tả ngắn</td>
                        <td><asp:TextBox id="txtSortDescription" TextMode="MultiLine" runat="server" Width="400px" Height="100px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>Tình trạng</td>
                        <td>
                            <asp:DropDownList ID="ddlStatus" runat="server" Width="200px"></asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>Người tạo</td>
                        <td>
                            <asp:DropDownList ID="ddlAdminUser" runat="server" Width="200px"></asp:DropDownList>
                        </td>
                    </tr>
                </table>  
            </div> 
            <div class="admin-right">
                <table class="adminform">
                    <tr>
                        <td colspan="2">
                            Mô tả chi tiết
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <uc1:TinyMCE runat="server" ID="txtContent" />
                        </td>
                    </tr>
                </table>
            </div> 
            <div class="clr"></div>
		</div>
		<div class="b">
			<div class="b">
				<div class="b"></div>
			</div>
		</div>
	</div>
    
    <!-- Validate -->
    <script type="text/javascript">
        $(document).ready(function () {
            $("#<%= lbtSave.ClientID %>").click(function () {
                $("#ErorMessage").html('');
                var rtnValue = validate($("#<%= txtInsuranceName.ClientID %>"), $("#ErorMessage"), "Vui lòng nhập tên bảo hiểm<br\>")
                    && validate($("#<%= txtInsuranceLevel.ClientID %>"), $("#ErorMessage"), "Vui lòng nhập mức bảo hiểm<br\>")
                    && validate($("#<%= txtSortDescription.ClientID %>"), $("#ErorMessage"), "Vui lòng nhập mô tả ngắn<br\>")
                    && validate($("#<%= dteInsuranceBegin.ClientID %>"), $("#ErorMessage"), "Vui lòng chọn ngày có hiệu lực<br\>")
                    && validateDropdown($("#<%= ddlPartner.ClientID %>"), $("#ErorMessage"), "Vui lòng chọn đối tác<br\>");
                return rtnValue;
            });
        });
    </script>
    
    <link rel="stylesheet" href="/css/datepicker/jquery.ui.all.css" />
	<script type="text/javascript" src="/js/ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="/js/ui/jquery.ui.datepicker.js"></script>
	<script type="text/javascript">
	    $(function () {
	        $("#<%= dteInsuranceBegin.ClientID %>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });
	    });
	</script>
</asp:content>
